<html>
<head>
  <script>
  var x = 0;
  var i;
  for (i=1; i<=1000; i++) {
      x = x + i;
  }
  alert(x);
  </script>
</head>
</html>
